商户预授权
生成商户预授权投放会员卡的凭证
请求参数 | 类型 | 描述 |
---|---|---|
card_id | string | 会员卡模板id |
json | object | 声明请求的JSON 数据结构 |
activate_type | string | 激活类型 |
navigate_back_previous_page | boolean | 设置用户在开卡完成后,是否返回拉起开卡组件的商家页面 |
activate_url | string | 跳转激活的url |
activate_appid | string | 跳转激活的appid |
activate_path | string | 跳转激活的path |
outer_str | string | 自定义场景值 |
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->permissionTokens->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'activate_type' => 'AUTO_ACTIVATE',
'navigate_back_previous_page' => true,
'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
'activate_appid' => 'wxea9c30a90fs8d3fe',
'activate_path' => 'pages/activate/activate',
'outer_str' => 'szwxtd',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/permission-tokens')->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'activate_type' => 'AUTO_ACTIVATE',
'navigate_back_previous_page' => true,
'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
'activate_appid' => 'wxea9c30a90fs8d3fe',
'activate_path' => 'pages/activate/activate',
'outer_str' => 'szwxtd',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
php
$instance['v3/marketing/membercard-open/cards/{card_id}/permission-tokens']->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'activate_type' => 'AUTO_ACTIVATE',
'navigate_back_previous_page' => true,
'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
'activate_appid' => 'wxea9c30a90fs8d3fe',
'activate_path' => 'pages/activate/activate',
'outer_str' => 'szwxtd',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->permissionTokens->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'activate_type' => 'AUTO_ACTIVATE',
'navigate_back_previous_page' => true,
'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
'activate_appid' => 'wxea9c30a90fs8d3fe',
'activate_path' => 'pages/activate/activate',
'outer_str' => 'szwxtd',
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/permission-tokens')->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'activate_type' => 'AUTO_ACTIVATE',
'navigate_back_previous_page' => true,
'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
'activate_appid' => 'wxea9c30a90fs8d3fe',
'activate_path' => 'pages/activate/activate',
'outer_str' => 'szwxtd',
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/permission-tokens']->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'activate_type' => 'AUTO_ACTIVATE',
'navigate_back_previous_page' => true,
'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
'activate_appid' => 'wxea9c30a90fs8d3fe',
'activate_path' => 'pages/activate/activate',
'outer_str' => 'szwxtd',
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
返回字典 | 类型 | 描述 |
---|---|---|
permission_token | string | 预授权token |
参阅 官方文档